1. Field of the Invention
The present invention relates to a switching hub apparatus for switching a MAC (Media Access Control) frame of the second layer, and more particularly to a switching hub apparatus of the composite type having a virtual LAN function and a router function.
2. Description of the Related Art
Conventionally, virtual LAN functions provided by a switching hub of the type mentioned are normally realized dividing in groups in units of a port, searching a learning table from a destination MAC address to discriminate an output port and transmitting a frame if an input port and the output port belong to the same group, but abandoning the frame if the input port and the output port do not belong to the same group.
In the method described above, the learning table for mapping MAC addresses to output ports are managed in a centralized fashion in the apparatus, and if the same MAC address is learned between ports, it is determined that the terminal has moved. Then, the last learned port is mapped to the MAC address, and a packet to be relayed is relayed in accordance with the mapping information.
The first problem of the prior art described above resides in that, if terminals in different virtual LANs (bridge groups) in the same apparatus have used the same MAC address, then communication with those terminals becomes unstable, and in an extreme case, communication is disabled.
That is, some of conventionally used network protocols have a mechanism which presupposes a local address and automatically rewrites an interface address not into a global MAC address but into a unique local address to be used. A router which relays a network of the type just described assigns a same local MAC address to two or more interfaces. Accordingly, if the router is connected between virtual LANs, such a situation that the same MAC address is connected in a plurality of virtual LANs occurs. In such a construction, a stable relaying operation cannot be expected.
The reason is described below. In the method described above, the table for mapping MAC addresses to output ports is managed in a centralized fashion in the apparatus, and a MAC address is learned and stored together with a port which was received last. Since this mechanism operates independently of the construction of the virtual LANs, when different groups have terminals having the same MAC address, entry of the table is performed based on a result of learning such that a port connected to a terminal which has outputted a frame last is mapped and stored as a port to which the MAC address is connected. When a frame destined for a terminal having the MAC address is received, to which one of the ports the frame is to be transferred depends upon the learning state of the table.
Accordingly, if, during communication between terminals A1 and A2 which belong to group A, terminal B1 having the same MAC address as terminal A1 begins communication in group B, under certain circumstances, such a situation occurs that a frame destined for terminal A1 from terminal A2 is transferred to a port learned with terminal B1. Since this frame is abandoned because it has been sent to a wrong group, it is considered that the frame is not received by terminal B1. However, such a situation that the frame is not transferred to terminal A1 occurs. Further, even if terminal A2 resends the frame, the situation in which transfer of a packet to terminal A1 does not take place, unless time-out of the learning table occurs or terminal A1 issues a new packet, does not change. If terminal A1 uses an ordinary interactive protocol, since it often occurs that terminal A1 continues to wait for a response from terminal A2, restarting of communication cannot be much expected, and communication between applications is interrupted.
The second problem of the prior art resides in that, if a switching hub constructing virtual LANs has a traffic of the third layer which spans a plurality of virtual LANs, since relaying is impossible with just a bridge function, an external router of the third layer is required.
For example, if a virtual LAN "A" and another virtual LAN "B" are set to a switching hub and have networks having different IP (Internet Protocol) subnetworks respectively, terminals of the virtual LANs "A" and "B" need not communicate with each other very much in an ordinary client-server application. However, for electronic mail or the like, routing must be performed which exceeds that of an IP sub-network. For this purpose, virtual LANs may be connected to each other by a router outside a switching hub. Generally, however, when virtual LANs are connected to each other by an external router, a high cost is required and the flexibility in modification of a network is deteriorated.
The reason is described below. An external router for connecting virtual LANs to each other is required to connect at least one physical interface for each virtual LAN. As the number of virtual LANs increases, also a corresponding increased number of physical interfaces are required, but generally a multi-port router is very expensive. Further, as the number of virtual LANs increases or decreases, the number of physical ports of the router must be increased or decreased, and although recombination of virtual LANs can be performed simply by using a switching hub, operationally this is not advantageous because it imposes restrictions on the router.